﻿@model IEnumerable<HelloMinasan.Domain.Song>
@{
    ViewBag.Title = "MySong";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="contentSection">
    <div class="titleSection">
        <img src="@Url.Content("~/Content/Images/song.png")" width="20" height="20"/>
        <span class="titleTab">@ViewBag.User's song list</span>
    </div>
    @if(User.Identity.IsAuthenticated){
        <a href="@Url.Action("AddSong", "Song")">
            <div class="titleSection">
                <img src="@Url.Content("~/Content/Images/addsmall.png")" width="20" height="20"/>
                <span class="titleTab">Add new song</span>
            </div>
        </a>
    }
    <div class="contentSectionInside" align="center">
        <table width="100%">
            <tr>
                <td valign="top" style="width: 155px;">
                    <div class="contentSection">
                        <img src="@Url.Content("~/Content/Images/pie_chart.png")" />
                        <strong>Statistic</strong>
                        <div class="contentSectionInside">
                            @{Html.RenderAction("UserSongCounter", "UserManagement");}
                        </div>
                    </div>
                </td>
                <td align="center" valign="top">
                    <div class="contentSection">
                        @foreach (var item in Model)
                        {
                            <div class="divListSongManagement">
                                <div class="imgdivListSong">
                                    <div class="starScore">@item.LikeTime</div>
                                </div>
                                <div class="titleSongName" title="@item.SongName">
                                    @if (item.SongName.Length > 10)
                                    {
                                        @item.SongName.Substring(0, 10) <text>...</text>
                                    }
                                    else
                                    {
                                        @item.SongName
                                    }
                                </div>
                                <div>
                                    @item.PostedDate
                                </div>
                                @*<div>
                                    <a href="@Url.Content("~/Song/DeleteSong/" + item.SongId)">
                                        <img src="@Url.Content("~/Content/Images/delete.png")" title="Delete this song" width="25"/>
                                    </a>
                                    <a href="@Url.Content("~/Song/EditSong/" + item.SongId)">
                                        <img src="@Url.Content("~/Content/Images/setting.png")" title="Edit this song" width="25" />
                                    </a>
                                    <a href="@Url.Content("~/Song/EditLyric/" + item.SongId)">
                                        <img src="@Url.Content("~/Content/Images/lessons.png")" title="Edit lyrics" width="25" />
                                    </a>
                                    <a href="@Url.Content("~/Song/EditTest/" + item.SongId)">
                                        <img src="@Url.Content("~/Content/Images/exam.png")" title="Edit lyrics" width="25" />
                                    </a>
                                </div>*@
                                <div align="center">
                                    <a href="@Url.Content("~/Song/Songs/" + item.Id)">
                                        <img src="/Content/Images/play.png" title="Listen to this song">
                                    </a>
                                </div>
                            </div>
                        }
                    </div>
                </td>
            </tr>
        </table>
    </div>
</div>
